## Makefile.am -- Process this file with automake to produce Makefile.in

AM_CFLAGS = -I$(top_builddir) -I$(top_srcdir)

bin_PROGRAMS = run2 checkX
bin_SCRIPTS = config-run2-example.sh
dist_man_MANS = checkX.1 run2.1
doc_DATA = run2-demo.xml

ICONS = \
	resources/X-boxed.ico \
	resources/X.Org_Logo.ico \
	resources/blue-rocket.ico \
	resources/konsole.ico \
	resources/run.ico \
	resources/rxvt.ico \
	resources/yellow-rocket.ico

run2_SOURCES = run2_main.c run2_gpl.c run2_gpl.h run2_res.rc $(ICONS)
nodist_run2_SOURCES =
checkX_SOURCES = checkX_main.c
nodist_checkX_SOURCES =
BUILT_SOURCES =

if REPLACE_GETOPT
  run2_SOURCES += getopt_long.c
  nodist_run2_SOURCES += getopt.h
  checkX_SOURCES += getopt_long.c
  nodist_checkX_SOURCES += getopt.h
  BUILT_SOURCES += getopt.h
endif

run2_LDFLAGS = -mwindows
run2_LDADD = ../lib/librun2.la ../cdsl/libcdsl.la $(XML_LIBS)

checkX_LDFLAGS = -mwindows
checkX_LDADD = ../lib/librun2.la ../cdsl/libcdsl.la

getopt.h: getopt.h_ Makefile
	$(AM_V_at)cp $< $@

EXTRA_DIST = getopt.h_ getopt_long.c \
	resources/X.Org_Logo.svg \
	resources/blue-rocket.svg \
	resources/yellow-rocket.svg \
	resources/README \
	run2-demo.xml \
	config-run2-example.sh

## Build rule for resource files
.rc.o:
	$(WINDRES) -o $@ -I$(srcdir) -i `test -f '$<' || echo '$(srcdir)/'`$<

run2_res.o: run2_res.rc $(ICONS)

